#include "light.h"
int Light::lightNum = 0;
 

Light::Light(GLfloat* ambient , GLfloat* diffuse, GLfloat* pos):
    ambientLight(ambient),
    diffuseLight(diffuse),
    lightPos(pos)
{
    if (lightNum > 7)
    {
        std::cout<<"**Failed to create light source\n Exceed maximum light source\n";
        exit(0);
    }
    lightIndex = GL_LIGHT0 + lightNum;
    lightNum++;

    //setup light, Turn on light as well
    glLightfv(lightIndex, GL_AMBIENT, ambientLight);
    glLightfv(lightIndex, GL_DIFFUSE, diffuseLight);
    glLightfv(lightIndex, GL_POSITION,lightPos);
}




    
